IF(NOT LMMS_SUPPORT_VST)
	RETURN()
ENDIF()

INCLUDE(BuildPlugin)
INCLUDE(ExternalProject)

ADD_SUBDIRECTORY(vstbase)

IF(LMMS_BUILD_LINUX AND WANT_VST_NOWINE)
	RETURN()
ENDIF()

SET(LMMS_BINARY_DIR ${CMAKE_BINARY_DIR})
SET(LMMS_SOURCE_DIR ${CMAKE_SOURCE_DIR})

SET(EXTERNALPROJECT_ARGS
	SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/RemoteVstPlugin"
	INSTALL_COMMAND ""
	BUILD_ALWAYS ON
)

SET(EXTERNALPROJECT_CMAKE_ARGS
	"-DLMMS_SOURCE_DIR=${CMAKE_SOURCE_DIR}"
	"-DLMMS_BINARY_DIR=${CMAKE_BINARY_DIR}"
	"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
	"-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}"
	"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
)

# build 32 bit version of RemoteVstPlugin
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/RemoteVstPlugin32.cmake")
# build 64 bit version of RemoteVstPlugin
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/RemoteVstPlugin64.cmake")
